@import "../mixins/mixins";
@import "../mixins/utils";

@mixin button-size($size) {
  @include box-size($size);
  font-size: map-get($text-map, $size);
}

@include b(button) {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  margin: 0;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  border: $border-base;
  -webkit-appearance: none;
  text-align: center;
  outline: none;
  transition: 0.2s;;
  @include utils-user-select(none);

  @extend .can-click;

  & + & {
    margin-left: 10px;
  }
  //取消uni默认的边框
  &:after {
    border: none;
  }

  //默认为默认颜色朴素按钮
  @include bg-color($color-theme);

  //遍历所有颜色样式类
  @each $key, $val in $bg-colors {
    &.bg-#{$key} {
      @include bg-color($val);
    }
  }

  //默认大小
  @include button-size(df);
  //设置盒子大小
  @each $key, $val in $size-map {
    &.#{$key} {
      @include button-size($key);
    }
  }
}
